package com.ruoyi.teaching.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.teaching.domain.dto.MultiParamDto;
import com.ruoyi.teaching.domain.dto.SearchParamDto;
import com.ruoyi.teaching.service.ITraceSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mouyiheng
 */
@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private ITraceSearchService traceSearchService;
    @PostMapping("/trace")
    public AjaxResult traceSearch(@RequestBody MultiParamDto multiParamDto){
        traceSearchService.traceSearch(multiParamDto);
        return AjaxResult.success();
    }

    @PostMapping("/es/trace/search")
    public AjaxResult esTraceSearch(@RequestBody SearchParamDto SearchParamDto){
        return AjaxResult.success(traceSearchService.esTraceSearch(SearchParamDto));
    }
}
